﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Text;

namespace TailordDS
{
    public class CustomConnectionString
    {
        public static void SetConnection(string ConnectionString)
        {
            PropertyInfo[] props = Properties.Settings.Default.GetType().GetProperties();
            foreach (PropertyInfo prop in props)
            {
                SettingsProperty sett = Properties.Settings.Default.Properties[prop.Name];
                if (sett != null)
                {
                    //Console.WriteLine("Found setting {0}", sett.Name);
                    sett.DefaultValue = ConnectionString;
                }
            }

            //Properties.Settings.Default["ConfExpertConnectionString"] = ConnectionString;
        }
    }
}